package com.cqupt.service.impl;

import com.cqupt.mapper.LogMapper;
import com.cqupt.pojo.LoginLogEntity;
import com.cqupt.pojo.OperationLogEntity;
import com.cqupt.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private LogMapper logMapper;

    /**
     *
     * @param operationLogEntity
     */
    @Override
    public void saveLog(OperationLogEntity operationLogEntity) {
        logMapper.saveOperationLog(operationLogEntity);
    }

    /**
     *
     * @param loginLogEntity
     */
    @Override
    public void saveLog(LoginLogEntity loginLogEntity) {

    }

    /**
     * 获取所有审计日志
     * @return
     */
    @Override
    public List<OperationLogEntity> getAllOperationLogs() {
        return logMapper.getAllOperationLogs();
    }

    /**
     *
     * @param startDate
     * @param endDate
     * @param level
     * @param objectModule
     * @param search_text
     * @return
     */
    @Override
    public List<OperationLogEntity> getAllOperationLogsByFilter(String startDate, String endDate, String level, String objectModule, String search_text) {
        return logMapper.getOperationLogsByFilter(startDate,endDate,level,objectModule,search_text);
    }

}
